The size of image data handled by image processing apparatuses such as digital multifunction peripherals is increasing with demands for colorization and higher resolution. For this reason, with image processing apparatuses, image data is handled internally in encoded form in order to save the capacity of memory or hard disk at the time of spooling image data or to shorten the access time. Handling encoded image data also reduces a bandwidth load on the internal bus and improves the efficiency of data processing performed in the system.
Examples of systems for encoding color still images include the JPEG system using discrete cosine transform and systems using Wavelet transform. These encoding systems realize high encoding efficiency by encoding an image in predetermined block units (for example, 8×8 pixels or 16×16 pixels) and performing discrete cosine transform, quantization, and entropy encoding on the encoded image. These encoding systems are variable-length encoding systems in which the amount of encoding varies for each image to be encoded. These systems are also lossy encoding systems in which pre-encoding data does not completely match data obtained by encoding and decoding.
Examples of techniques for encoding a feature quantity of an image, instead of encoding pixels themselves, include known encoding systems such as the run-length encoding system for storing pixel data and the number of contiguous pixel data pieces, and the JBIG system in which differential encoding is repeatedly performed on encoded data of a low-resolution image. These encoding systems are lossless encoding systems in which pre-encoding data completely matches data obtained by encoding and decoding.
Incidentally, in order to perform predetermined image processing (such as deleting pixels) on image data encoded by an image processing apparatus, it is necessary to decode the image data and acquire original image data that is not encoded before performing the image processing. For example, in the aforementioned JPEG system, original image data is obtained by decoding image data that has been encoded by discrete cosine transform, by inverse discrete cosine transform, and image processing is performed on the obtained original image data. Then, after the image processing ends, the processed data is spooled after being encoded again as necessary. In the case of performing image processing multiple times, a sequence of decoding, image processing, and encoding is repeatedly performed a required number of times.
An example will be explained below, wherein image processing such as pixel deletion is required. In this example, an image with 100 (width)×120 (height) pixels is encoded in units of 8×8 pixels (hereafter referred to tiles). In addition, this image is encoded from the leftmost region. Then, 8×12=96 columns from the leftmost position will be encoded in tiles, and 4 columns at the rightmost position will remain. In this case, four columns of white pixels can be added to the remaining pixels to generate the columns of 8×8 tiles, and thus the given image will be encoded using the generated tiles.
In some instances, it is necessary to arrange encoded images side by side (i.e., in an image combination process). However, when images encoded as described above are simply arranged side by side, added white pixels will remain between the two images, and it is therefore desirable to delete such white pixels. Usually, such a deletion process will require decoding of the encoded images, deletion of the white pixels, and further re-encoding of the image after deletion. Such image combination processing is required when two images are arranged side by side and are printed out (e.g., for 2-in-1 printing, or aggregate printing). Such an image combination processing is also required when a repeated image printing function is required (e.g., a function of printing a scanned business card so that it is repeatedly placed without gaps on a predetermined size of a paper).
In the case of using a lossy encoding system as disclosed in Japanese Patent Laid-open No. 9-261632, processing resources are necessary in order to locally perform decoding processing, and, although locally, image quality is degraded because of performing encoding and decoding processing. Meanwhile, in the case of using a lossless encoding system such as the run-length encoding system, image quality degradation due to repeated execution of encoding and decoding in order to perform image processing multiple times does not occur, but decoding processing needs to be performed at least once in order to perform image processing, and therefore processing resources are necessary for that processing. Furthermore, in order to improve the performance of image processing, not only an image processing unit but also both encoding and decoding processing units need to offer performance equivalent to that required for image processing. For example, in the case of using a complicated encoding system such as the JBIG system, the circuit scale will increase because of required multiplexing or parallelization of processing circuits.